package com.hr.checkrepetition.enums.serializer;

import com.hr.checkrepetition.enums.ResponseStatusEnum;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.util.Optional;

public class ResponseStatusSerializer extends JsonSerializer<ResponseStatusEnum> {
    @Override
    public void serialize(ResponseStatusEnum value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        Optional<ResponseStatusEnum> data = Optional.of(value);
        gen.writeObject(data.get());
    }
}
